<?php echo $this->element('estilos/tablas'); ?>
<div class="col-sm-12">
    <section class="panel">
        <header class="panel-heading">
            Usuarios
            <span class="tools pull-right">
                <a href="javascript:;" class="fa fa-chevron-down"></a>
                <a href="javasrcipt:;" class="fa fa-cog"></a>
                <a href="javascript:;" class="fa fa-times"></a>
            </span>
        </header>
        <div class="panel-body">
            <div class="adv-table">         
                <table  class="display table table-bordered table-striped" id="dynamic-table">
                    <thead>
                        <tr>
                            <th>Nombre</th>
                            <th>Usuario</th>
                            <th>Acciones</th>                            
                        </tr>
                    </thead>
                    <tbody>
                        <?php foreach ($users as $user): ?>
                            <tr class="gradeC">
                                <td><?php echo $user['User']['nombre']; ?></td>
                                <td><?php echo $user['User']['username']; ?></td>
                                <td> 
                                    <a href="<?php echo $this->Html->url(array('controller'=>'Users','action' => 'editar', $user['User']['id']));?>"data-toggle="tooltip" title="Editar Usuario">
                                        <?php echo $this->Html->image('iconos/edit.png'); ?>
                                    </a>
                                    <a href="<?php echo $this->Html->url(array('controller'=>'Permitidos','action' => 'insertar', $user['User']['id']));?>"data-toggle="tooltip" title="Asignados">
                                        <?php echo $this->Html->image('iconos/listado.png'); ?>
                                    </a>
                                    <?php echo $this->Html->link($this->Html->image('iconos/del.png'), array('controller'=>'Users','action'=>'eliminar', $user['User']['id']), array('escape'=>false, 'confirm'=>'Esta seguro de Eliminar')); ?>
                                                                 
                                </td>                           
                            </tr>
                        <?php endforeach; ?>                        
                    </tbody>
                    <tfoot>
                        <tr>
                            <th>Nombre</th>
                            <th>Usuario</th>
                            <th>Acciones</th>
                        </tr>
                    </tfoot>
                </table>

            </div> 
        </div>
    </section>
</div>
<?php echo $this->element('scripts/tablas'); ?>
